<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class ExpertValidate extends Validate
{
    protected $rule = [
        'id'            => 'require|number',
        'user_nickname' => 'require',
        'user_login'    => 'require',
        'user_pass'     => 'require',
        'type'          => 'require',
    ];
    protected $message = [
        'id.require'            => 'id不能为空',
        'id.number'             => 'id必须为数字',
        'user_nickname.require' => '姓名不能为空',
        'user_login.require'    => '账号不能为空',
        'user_pass.require'     => '密码不能为空',
        'type.require'          => '请选择专家类型',
    ];

    protected $scene = [
        'add'  => ['user_nickname','user_login','user_pass','type'],
        'edit' => ['id','user_nickname','user_login','type'],
    ];
}